<!doctype html public "-//w3c//dtd html 3.2//en">

<html>
	
	<head>
		<title>
			fMRI Sandbox file format
		</title>
	</head>
	
	<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
		<h2>
			The file format
		</h2>
		
		Sandbox uses one proprietary and a couple of ordinary file formats.
		It can read analyze (.img/.hdr) files as well as the Bruker reco format. It
		cannot yet read Nifti, but this is in development. It can also read SPM structs (SPM.mat).
		<p>
		To store its image information, sandbox uses a 3D- or 4D-Array. Alternatively,
		you can load the Analyze images sequentially,
		and then load the respective experiment information.
</p>
		<p>
		To store its experiment information, Sandbox uses a struct called sandbox. The
		struct has a couple of subfields, amongst others the following. 
		This struct can also be loaded separately
		after the image data have been loaded into the GUI
		</p>
		<ul>
			<li>
			<b>TR</b>: <br>Your repetition time. Please make sure that you either derive this from
			your stimulus files or manually enter it,
			otherwise a generic value of 2 s is used.
			</li>
			<li>
			<b>hdr</b>: <br>your header information. If you load in Analyze format files, Sandbox will
			automatically store the header information,
			otherwise it will take a generic header template.
			</li>
			
			<li>
			<b>onset</b>: <br>An array with your stimulus onset information consisting of one vector per condition.
			For every stimulus onset, there should be a 1 in the respective column of the file, e.g 1 0 0 0 1 0 0 0 for a vector in which there is a stimulus onset in during the first and 5th volume. The format is
			volume number x condition number. The number of volumes needs to be the same as the number of volumes in your image data.
			</li>
			<li>
			<b>intrial</b>: <br>An array that contains the trial information in the format 5 x volume number. The first column contains consists of zeroes and ones indicating which parts of the dataset are within a trial.
The second column indicates the position of the volume within the trial (e.g. 1 2 3 4) and is zero for all time periods without trial information. The third column contains an index of the trial number (e.g. 1 1 1 0 0 0 2 2 2 0 0 0 3 3 3), with all volumes being zero for time periods outside of trials. The 4th column contains an index of the run number, with all volumes within a row labelled with the same number. The 5th column contains an index of the session number, with all volumes belonging to a session labelled with the same number. The 6th column just labels all the volumes within the dataset with a number, starting from 1. The total number of volumes needs to be the same as the number of volumes in your image dataset.
			</li>
			<li>
			<b>hemodynamics</b>: <br>An array containing vectors of your predicted hemodynamic responses for each stimulus or event. If you don't have it, use the hemodynamics function to generate it from your regressors.
			The format is volume number x condition number.
			</li>
			<li>
			<b>hemodynamics_deriv</b>: <br>A vector of your predicted hemodynamic response including
			the time and dispersion derivative.
			If you don't have it, use the hemodynamics function to generate it from your
			regressors. The format is volume number x condition number.
			</li>
			<li>
			<b>discard</b>: <br>the volumes that show artifacts and are marked for discarding (e.g.
			1,49,76 etc.)
			</li>
			<li>
			<b>fullscan</b>: <br>If the scan does still contain all volumes or has been truncated or
			concatenated.
			</li>
		</ul>
		
	</body>
</html>
